import 'package:json_annotation/json_annotation.dart';

part 'advertisement.g.dart';

@JsonSerializable()
class Advertisement extends Object {
  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'image')
  String image;

  @JsonKey(name: 'url')
  String url;

  @JsonKey(name: 'sort')
  int sort;

  @JsonKey(name: 'created_at')
  String createdAt;

  @JsonKey(name: 'page_url')
  String pageUrl;

  @JsonKey(name: 'page_type')
  String pageType;

  @JsonKey(name: 'page')
  String page;

  @JsonKey(name: 'params')
  String params;

  @JsonKey(name: 'name')
  String name;

  Advertisement(
    this.id,
    this.image,
    this.url,
    this.sort,
    this.createdAt,
    this.pageUrl,
    this.pageType,
    this.params,
    this.page,
    this.name,
  );

  factory Advertisement.fromJson(Map<String, dynamic> srcJson) =>
      _$AdvertisementFromJson(srcJson);
}
